package com.zzxx.photograph.web.servlet;

import com.zzxx.photograph.domain.ResultInfo;
import com.zzxx.photograph.service.ImgService;
import com.zzxx.photograph.service.impl.ImgServiceImpl;
import com.zzxx.photograph.web.BaseServlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/read/*")
public class ReadingServlet extends BaseServlet {
    private ImgService imgService = new ImgServiceImpl();
    public void reading(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String iid = req.getParameter("iid");
        imgService.addClick(Integer.parseInt(iid));
        ResultInfo info =new ResultInfo();
        info.setFlag(true);
        writeValue(resp,info);
    }
}
